package org.xxforest.game.core.scenes.scene2d.events.type;

import org.xxforest.game.core.scenes.scene2d.XXNode;
import org.xxforest.game.core.scenes.scene2d.XXPointerTouch;
import org.xxforest.game.core.scenes.scene2d.events.XXEvent;
import org.xxforest.game.core.scenes.scene2d.events.XXEventType;

import com.badlogic.gdx.utils.Pools;

public class XXTouchDragEvent implements XXEvent{
	
	private XXPointerTouch pointerTouch ;
	private XXNode node ;
	
	public static XXTouchDragEvent create(){
		return Pools.obtain(XXTouchDragEvent.class);
	}
	
	public XXTouchDragEvent touchDrag(XXNode node , XXPointerTouch pointerTouch){
		this.node = node ;
		this.pointerTouch = pointerTouch ;
		return this ;
	}

	@Override
	public void dispose() {
		pointerTouch = null ;
		node = null ;
		Pools.free(this);
	}

	@Override
	public XXEventType getEventType() {
		return XXEventType.TOUCHDRAGGED;
	}

	public XXPointerTouch getPointerTouch() {
		return pointerTouch;
	}

	public XXNode getNode() {
		return node;
	}

}
